package com.scheduling.system.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.scheduling.common.annotation.Log;
import com.scheduling.common.core.controller.BaseController;
import com.scheduling.common.core.domain.AjaxResult;
import com.scheduling.common.enums.BusinessType;
import com.scheduling.system.domain.Skillqueuemanagement;
import com.scheduling.system.service.ISkillqueuemanagementService;
import com.scheduling.common.utils.poi.ExcelUtil;
import com.scheduling.common.core.page.TableDataInfo;

/**
 * 技能队列管理Controller
 * 
 * @author mj
 * @date 2025-05-07
 */
@RestController
@RequestMapping("/system/skillqueuemanagement")
public class SkillqueuemanagementController extends BaseController
{
    @Autowired
    private ISkillqueuemanagementService skillqueuemanagementService;

    /**
     * 查询技能队列管理列表
     */
    @PreAuthorize("@ss.hasPermi('system:skillqueuemanagement:list')")
    @GetMapping("/list")
    public TableDataInfo list(Skillqueuemanagement skillqueuemanagement)
    {
        startPage();
        List<Skillqueuemanagement> list = skillqueuemanagementService.selectSkillqueuemanagementList(skillqueuemanagement);
        return getDataTable(list);
    }

    /**
     * 导出技能队列管理列表
     */
    @PreAuthorize("@ss.hasPermi('system:skillqueuemanagement:export')")
    @Log(title = "技能队列管理", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, Skillqueuemanagement skillqueuemanagement)
    {
        List<Skillqueuemanagement> list = skillqueuemanagementService.selectSkillqueuemanagementList(skillqueuemanagement);
        ExcelUtil<Skillqueuemanagement> util = new ExcelUtil<Skillqueuemanagement>(Skillqueuemanagement.class);
        util.exportExcel(response, list, "技能队列管理数据");
    }

    /**
     * 获取技能队列管理详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:skillqueuemanagement:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(skillqueuemanagementService.selectSkillqueuemanagementById(id));
    }

    /**
     * 新增技能队列管理
     */
    @PreAuthorize("@ss.hasPermi('system:skillqueuemanagement:add')")
    @Log(title = "技能队列管理", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody Skillqueuemanagement skillqueuemanagement)
    {
        return toAjax(skillqueuemanagementService.insertSkillqueuemanagement(skillqueuemanagement));
    }

    /**
     * 修改技能队列管理
     */
    @PreAuthorize("@ss.hasPermi('system:skillqueuemanagement:edit')")
    @Log(title = "技能队列管理", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody Skillqueuemanagement skillqueuemanagement)
    {
        return toAjax(skillqueuemanagementService.updateSkillqueuemanagement(skillqueuemanagement));
    }

    /**
     * 删除技能队列管理
     */
    @PreAuthorize("@ss.hasPermi('system:skillqueuemanagement:remove')")
    @Log(title = "技能队列管理", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(skillqueuemanagementService.deleteSkillqueuemanagementByIds(ids));
    }
}
